<template>
    <FpiElPageLayout title="Echarts使用方式">
        <div class="container">
            <h2>图表测试1</h2>
            <BaseECharts width="600px" height="400px" :options="chart1Options"></BaseECharts>
            <h2>下面是个图片</h2>
            <img :src="publicImage1" alt="altText" />
        </div>
    </FpiElPageLayout>
</template>

<script lang="ts" setup name="echarts-use-demo">
import * as BaseOptions from '@/components/BaseECharts/baseOptions'

const chart1Options = reactive({
    tooltip: BaseOptions.getBaseToolTip(),
    grid: BaseOptions.getBaseGrid(),
    xAxis: BaseOptions.getBaseXAxis(),
    yAxis: BaseOptions.getBaseSingleYAxis(),
    series: [
        {
            name: 'Email',
            type: 'line',
            stack: 'Total',
            areaStyle: {},
            emphasis: {
                focus: 'series',
            },
            data: [120, 132, 101, 134, 90, 230, 210],
        },
        {
            name: 'Union Ads',
            type: 'line',
            stack: 'Total',
            areaStyle: {},
            emphasis: {
                focus: 'series',
            },
            data: [220, 182, 191, 234, 290, 330, 310],
        },
        {
            name: 'Video Ads',
            type: 'line',
            stack: 'Total',
            areaStyle: {},
            emphasis: {
                focus: 'series',
            },
            data: [150, 232, 201, 154, 190, 330, 410],
        },
        {
            name: 'Direct',
            type: 'line',
            stack: 'Total',
            areaStyle: {},
            emphasis: {
                focus: 'series',
            },
            data: [320, 332, 301, 334, 390, 330, 320],
        },
        {
            name: 'Search Engine',
            type: 'line',
            stack: 'Total',
            label: {
                show: true,
                position: 'top',
            },
            areaStyle: {},
            emphasis: {
                focus: 'series',
            },
            data: [820, 932, 901, 934, 1290, 1330, 1320],
        },
    ],
})

const publicImage1 = import.meta.env.BASE_URL + 'images/test-img.png'
</script>
